package me.baicai.weixin.application;

import java.util.List;
import java.util.Map;


/**
 * @description:
 * @author: [ 超级大白菜 ]
 * @date: 2019-11-11 10:01
 */
public class BasicService
{
    public Result success()
    {
        return this.success("提交成功");
    }

    public Result success(Object En)
    {
        return new Result(En);
    }

    public Result success(Map map)
    {
       return new Result(200, map);
    }

    public Result success(Map map, Object En)
    {
        return new Result(200, map,En);
    }

    public Result success(String message)
    {
        return new Result().success(message);
    }

    public Result response(String message)
    {
        return new Result();
    }

    public Result error(String message)
    {
        return new Result().error(message);
    }

    public Result error(int code, Object En)
    {
        return new Result(En,code);
    }

    public Result error(Map map, int code)
    {
        return new Result().error(map,code);
    }

    public Result error()
    {
        return new Result().error();
    }

    public Result error(int code , String message)
    {
        return new Result().error(message, code);
    }

    public Result response(int code, String message)
    {
        return new Result(code, message);
    }

    public Result success(Result result)
    {
        return new Result(result);
    }

    public Result success(List list)
    {
            Result Result = new Result(200, list);
            Result.setTotal(list.size());
            return Result;
    }
}
